package com.evil.log.api;

import com.evil.common.family.constant.ServiceNameConstant;
import com.evil.log.config.LogFeignErrorDecoder;
import com.evil.log.pojo.dto.RequestLogDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 请求日志接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.LOG_SERVICE, configuration = {LogFeignErrorDecoder.class})
public interface RemoteRequestLogService {

    /**
     * 插入请求日志
     *
     * @param requestLog requestLog
     */
    @PostMapping("/remote/request/log")
    RequestLogDTO insertRequestLog(@Validated @RequestBody RequestLogDTO requestLog);
}
